public class Rectangle extends ASingleShape {
	private int width;
	private int height;

	public Rectangle(CartesianPoint location, int width, int height) {
		super(location);
		this.width = width;
		this.height = height;
	}

	@Override
	public double area() {
		return this.height * this.width;
	}

	@Override
	public boolean contains(CartesianPoint that) {
		int thisX = this.location.getX();
		int thisY = this.location.getY();
		return (that.getX() >= thisX && that.getX() <= thisX + this.width)
				&& (that.getY() >= thisY && that.getY() <= thisY + this.height);
	}

	@Override
	public Rectangle boundingBox() {
		return new Rectangle(this.location, this.width, this.height);
	}
	public boolean equals(Object o){
	if(null==o|| !(o instanceof Rectangle))
		return false;
	else{
		Rectangle that= (Rectangle)o;
		return (this.location.equals(that.location)&&
				this.width==that.width&& this.height==that.height);
	}
	}

	@Override
	public double distancoTo0() {
		// TODO Auto-generated method stub
		return 0;
	}

}
